package com.kuaidi100.sdk.request;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * @Author: api.kuaidi100.com
 * @Date: 2020-07-16 13:41
 */
public class SubscribeReq extends BaseRequest {
    /**
     * 返回数据格式(json、xml、text)
     */
    private String schema;
    /**
     * 其他参数
     */
    private String param;

    @Override
    public String toString() {
        try {
            ObjectMapper objectMapper = new ObjectMapper();
            return objectMapper.writeValueAsString(this);
        } catch (Exception e) {
            return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                    .append("schema", schema)
                    .append("param", param)
                    .toString();
        }
    }

    public String getSchema() {
        return schema;
    }

    public void setSchema(String schema) {
        this.schema = schema;
    }

    public String getParam() {
        return param;
    }

    public void setParam(String param) {
        this.param = param;
    }
}
